package leetcode;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * ClassName: JITuT2
 * Package: leetcode
 * Description:
 *
 * @Author wjn
 * @Create 2025/9/26 15:18
 * @Version 1.0
 */
public class JITuT2 {

    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        PrintWriter pw = new PrintWriter(System.out);

        int T = Integer.parseInt(br.readLine());

        while (T-- > 0) {
            String[] parts = br.readLine().split(" ");
            long a = Long.parseLong(parts[0]);
            long b = Long.parseLong(parts[1]);
            long c = Long.parseLong(parts[2]);

            long operations = 0;

            if (b > a && a > c) {
                operations = 0;
            } else {
                long a_new = a;
                long c_new = c;

                long delta = 0;

                if (a <= c) {
                    delta = c - a + 1;
                    a_new = a + delta;
                } else {
                   a_new = a;
                }

                if (b<=a_new) {
                    delta += (a_new +1) -b;
                }

                operations = delta;
            }
            pw.println(operations);
        }
        pw.flush();
        br.close();
        pw.close();

    }
}
